import lombok.extern.java.Log;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext.xml", "file:src/main/webapp/WEB-INF/mvc-servlet.xml"}, inheritLocations = true)
@ActiveProfiles(value = "test")
@Log
public class testRedis {
    @Autowired
    private RedisTemplate redisTemplate;
    @Test
    public void demo(){
        redisTemplate.boundValueOps("haha").set("abcdd--------");

        log.info(String.valueOf(redisTemplate.boundValueOps("haha").get()));
    }
}
